import { fromJS } from 'immutable';
import reducerHandler from 'shared/utils/reducerHandler';

const initialState = fromJS({
  isAuthenticated: false,
  userData: {},
});

const handlers = {
  ['SIGN_IN'](state, { payload }) {
    const newState = state.set('isAuthenticated', true).set('userData',payload);
    console.log('newState',newState.get('isAuthenticated'));
    return newState;
  }
};

export default reducerHandler(initialState, handlers);
